#include <stdio.h>
// 函数指针的示例
int add(int a, int b)
{
  return a + b;
}

int substract(int a, int b)
{
  return a - b;
}

int compute(int (*operation)(int, int), int x, int y)
{
  return operation(x, y);
}

int main()
{
  // 通过 compute 函数调用 add 和 substract
  int addResult = compute(add, 5, 10);
  int subResult = compute(substract, 5, 10);
  printf("加法结果：%d\n", addResult);
  printf("减法结果：%d\n", subResult);

  return 0;
}